﻿namespace WT.OpenIddict.Domain.Shared.VertifyCodeUtils;

public static class VertifyCodeGenerator
{
    public static string GenerateCode(int length)
    {
        const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
        var random = new Random();
        var codeChars = new char[length];
        for (var i = 0; i < length; i++) codeChars[i] = chars[random.Next(chars.Length)];
        return new string(codeChars);
    }
}